package com.example.acitividemo2.controller;

import com.example.acitividemo2.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Slf4j
@RestController
public class TestController {

    @Autowired
    TestService testService;

    @RequestMapping("/")
    public String ss() {
        return testService.getMessage();
    }

    @RequestMapping("/all")
    public List<Map<String, Object>> all() {
        return testService.selectAll();
    }

    @RequestMapping("/name")
    public List<Map<String, Object>> name() {
        return testService.selectNames();
    }
}
